package com.sen.service;

import com.sen.mapper.DepartmentMapper;
import com.sen.pojo.Department;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Collection;

@Service
public class DepartmentService {

    @Autowired
    DepartmentMapper departmentMapper;

    //获取所有部门信息
    public Collection<Department> getDepartments(){
        return departmentMapper.getDepartments();
    }

    //通过id得到部门
    public Department getDepartmentById(Integer id){
        return departmentMapper.getDepartmentById(id);
    }

}
